#include <stdio.h>
#include <stdlib.h>

#define NormalCode 0
#define ErrorCode 1

typedef struct StringNode *Position; /* 指针即结点位置 */
struct StringNode {
    char data; /* 存储数据 */
    Position next; /* 链接存储中下一个元素的位置 */
};
typedef struct StringHeadNode *String;
struct StringHeadNode {
    Position head; /* 字符串头指针，初始化为NULL */
    int length; /* 字符串长度 */
};

String InitStr() {
    /* 初始化一个空的字符串 */
    String s;

    s = (String)malloc(sizeof(struct StringHeadNode));
    s->head = NULL;
    s->length = 0;

    return s;
}

/* 算法4-7：字符串删除操作  StrRemove(s, pos, len) */
void StrRemove(String s, int pos, int len) {
    Position p, deleted, t;
    int count;

    if (s->length > 0) {
        p = s->head;
        count = 1;
        while ((p != NULL)
                && (count < (pos - 1))) { /* 找第pos个元素的前一个元素 */
            count++;
            p = p->next;
        }
        if ((pos == 1) || (p != NULL && count == (pos - 1))) {
            /* 将p后面的len个结点删除 */
            if (pos == 1) {
                deleted = s->head;
            } else {
                deleted = p->next;
            }
            count = 0;
            while ((deleted != NULL)
                    && (count < len)) { /* 不足len个则一直删到末尾 */
                t = deleted->next;
                free(deleted);
                count++;
                s->length--;
                deleted = t;
            }
            if (pos == 1) {
                s->head = deleted;
            } else {
                p->next = deleted;
            }
        }
    }
}
/* 算法4-7 结束 */

String ReadString() {
    String s;
    Position tail;
    char c;

    s = InitStr(); /* 创建空的字符串 */
    s->head = (Position)malloc(sizeof(struct StringNode));
    tail = s->head; /* 先创建临时空头结点 */
    c = getchar();
    while (c != '\n') {
        tail->next = (Position)malloc(sizeof(struct StringNode));
        tail->next->data = c;
        tail = tail->next;
        s->length++;
        c = getchar();
    }
    tail->next = NULL; /* 链表收尾 */
    tail = s->head;
    s->head = s->head->next;
    free(tail); /* 删除临时空头结点 */
    return s;
}

void PrintString(String s) {
    Position p;

    p = s->head;
    while (p != NULL) {
        printf("%c", p->data);
        p = p->next;
    }
}

int main(void) {
    int pos, len;
    String s;

    s = ReadString();
    scanf("%d %d", &pos, &len);
    StrRemove(s, pos, len);
    PrintString(s);

    return 0;
}